<!DOCTYPE html>
<html>
<head>
    <title>基础文本字符</title>
    <meta charset="utf-8">
    <script src="../dev-lib/jquery-1.10.2.min.js"></script>
    <script src="../dev-lib/kitygraph.all.js"></script>
    <!--<script src="../dev-lib/dev-define.js"></script>-->
    <!--<script>-->
        <!--inc.config({-->
            <!--base: '../src'-->
        <!--});-->
    <!--</script>-->
    <!--<script src="../dev-lib/start.js"></script>-->
    <!--<script src="../dev-lib/exports.js"></script>-->
    <!--<script src="../dev-lib/dev-start.js"></script>-->
    <script src="../dist/kity-formula.all.js"></script>
    <script>
        window.onload = function () {

            var formula = null;

            kf.ResourceManager.ready( function ( Formula ) {

                formula = new Formula( document.getElementById( "container" ) );

                var exps = [
                    new kf.TextExpression( "abcdefghijklmnopqrstuvwxyz" ),
                    new kf.TextExpression( "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ),
                    new kf.TextExpression( "0123456789" ),
                    new kf.TextExpression( "+ - = < > ' `` ^ a_b \" | [ ] ( ) , : #" ),
                    new kf.TextExpression( "\\imath\\\\jmath\\" )
                ];

                kity.Utils.each( exps, function ( exp ) {
                    formula.appendExpression( exp );
                } );

            }, {
                path: '../src/resource/'
            } );

            document.onkeydown = function ( e ) {

                if ( ( e.ctrlKey || e.metaKey ) && e.keyCode === 83 ) {

                    e.preventDefault();

                    formula.toPNG( function ( url ) {

                        var image = new Image();

                        image.src = url;

                        image.style.border = "1px solid black";

                        document.body.appendChild( image );

                    } );

                }

            };

        };

    </script>
</head>
<body>
    <h1>基本字符集</h1>
    <p>
        构造方法： new kf.Text( "abc" );
    </p>
    <p>
        基本字符集包含了0-9，a-z，A-Z，+，-，=，<，>，'，|，[，]，(，) 等字符， 这些字符可以不经转义直接输入。
    </p>
    <div id="container"></div>
</body>
</html>